package com.evil.application.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evil.common.application.enums.robot.RobotRuleSourceTypeEnum;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 机器人规则表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@TableName(value = "evil_application_robot_rule")
public class ApplicationRobotRule implements Serializable {

    /**
     * id
     */
    @TableId(value = "robot_rule_id", type = IdType.AUTO)
    private Long robotRuleId;

    /**
     * 企业id
     */
    @TableField(value = "enterprise_id")
    private Long enterpriseId;

    /**
     * 机器人规则类型（1-新增，2-修改）
     */
    @TableField(value = "robot_rule_type")
    private Integer robotRuleType;

    /**
     * 源类型（1-流程节点）
     *
     * @see RobotRuleSourceTypeEnum#getId()
     */
    @TableField(value = "source_type")
    private Integer sourceType;

    /**
     * 源id
     */
    @TableField(value = "source_id")
    private Long sourceId;

    /**
     * 规则目标id
     */
    @TableField(value = "rule_target_id")
    private Long ruleTargetId;

    /**
     * 匹配类型（1-自定义，2-匹配字段）
     */
    @TableField(value = "matching_type")
    private Integer matchingType;

    /**
     * 变更类型 （1-添加数据，2-更新已有数据，3-覆盖数据）
     */
    @TableField(value = "change_type")
    private Integer changeType;

    /**
     * 上级规则id
     */
    @TableField(value = "parent_robot_rule_id")
    private Long parentRobotRuleId;

    /**
     * 规则源id
     */
    @TableField(value = "rule_source_id")
    private Long ruleSourceId;

    /**
     * 默认值
     */
    @TableField(value = "default_value")
    private String defaultValue;

    /**
     * 源规则id
     */
    @TableField(value = "source_robot_rule_id")
    private Long sourceRobotRuleId;

    /**
     * 是否已删除(0:否, 1:是)
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    /**
     * 创建人
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人名字
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 修改操作人
     */
    @TableField(value = "modifier_id")
    private Long modifierId;

    /**
     * 修改操作人名字
     */
    @TableField(value = "modifier_name")
    private String modifierName;

    /**
     * 创建时间
     */
    @TableField(value = "created")
    private Date created;

    /**
     * 更新时间
     */
    @TableField(value = "updated")
    private Date updated;

    @Serial
    private static final long serialVersionUID = 1L;

    public static final String COL_ROBOT_RULE_ID = "robot_rule_id";

    public static final String COL_ROBOT_RULE_TYPE = "robot_rule_type";

    public static final String COL_SOURCE_TYPE = "source_type";

    public static final String COL_SOURCE_ID = "source_id";

    public static final String COL_RULE_TARGET_ID = "rule_target_id";

    public static final String COL_MATCHING_TYPE = "matching_type";

    public static final String COL_CHANGE_TYPE = "change_type";

    public static final String COL_PARENT_ROBOT_RULE_ID = "parent_robot_rule_id";

    public static final String COL_RULE_SOURCE_ID = "rule_source_id";

    public static final String COL_DEFAULT_VALUE = "default_value";

    public static final String COL_SOURCE_ROBOT_RULE_ID = "source_robot_rule_id";

    public static final String COL_IS_DELETED = "is_deleted";

    public static final String COL_CREATOR_ID = "creator_id";

    public static final String COL_CREATOR_NAME = "creator_name";

    public static final String COL_MODIFIER_ID = "modifier_id";

    public static final String COL_MODIFIER_NAME = "modifier_name";

    public static final String COL_CREATED = "created";

    public static final String COL_UPDATED = "updated";
}
